<?php

namespace server\dao;

use Yii;
use yii\mongodb\Exception;
use yii\mongodb\Query;

/**
 * This is the model class for collection "lic".
 *
 * @property \MongoDB\BSON\ObjectID|string $_id
 */
class Lic extends \yii\mongodb\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function collectionName()
    {
        return 'lic';
    }

    /**
     * {@inheritdoc}
     */
    public function attributes()
    {
        return [
            '_id',
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            '_id' => 'ID',
        ];
    }

    /**
     * 获得 lic
     *
     * @return mixed
     */
    public function getLic()
    {
        try {
            Yii::$app->mongodb->createCommand()->createCollection($this->collectionName());
        } catch (Exception $e) {

        }
        $query = new Query();
        return $data = $query->where(['id'=>1])->from($this->collectionName())->one();
    }
}
